<template>
	<div id="mPageContainer" style="overflow: auto;">
		<component :is="component" :paraMap="paraMap" ref="comp"></component>
	</div>
</template>

<script>
	import $ from 'jquery';
	export default {
		name: 'MPageContainer',
		inject:['children'],
		data() {
			return {
				paraMap:null,
				component:"",
			}
		},mounted() {
			$("#mPageContainer").height($(window).height()-51);
		},
		methods: {
			setComponent(component,paraMap){
				this.children=[];
				this.paraMap=paraMap;
				if(this.component==component){
					this.component="";
					this.$nextTick(function(){
						this.component=component;
						if(component=="mobile-page-component"){
							this.$nextTick(function(){
								this.$refs.comp.navigatePage(paraMap["pageCode"],{});
							});
						}
					});	
				}else{
					this.component=component;
					if(component=="mobile-page-component"){
						this.$nextTick(function(){
							this.$refs.comp.navigatePage(paraMap["pageCode"],{});
						});
					}
				}
			}
		},
	}
</script>

<style>
</style>
